home *** CD-ROM | disk | FTP | other *** search
/ ADA Programming Guide / ADA Programming Guide.iso / ada_gnu / adainc / a-strsea.ads < prev    next >
Text File  |  1996-01-30  |  4KB  |  90 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUNTIME COMPONENTS                          --
  4. --                                                                          --
  5. --                   A D A . S T R I N G S . S E A R C H                    --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.7 $                              --
  10. --                                                                          --
  11. --           Copyright (c) 1992,1993,1994 NYU, All Rights Reserved          --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. --
  22. --                                                                          --
  23. ------------------------------------------------------------------------------
  24.  
  25. --  This package contains the search functions from Ada.Strings.Fixed. They
  26. --  are separated out because they are shared by Ada.Strings.Bounded and
  27. --  Ada.Strings.Unbounded, and we don't want to drag other irrelevant stuff
  28. --  from Ada.Strings.Fixed when using the other two packages. We make this
  29. --  a private package, since user programs should access these subprograms
  30. --  via one of the standard string packages.
  31.  
  32.  
  33. with Ada.Strings.Maps;
  34.  
  35. private package Ada.Strings.Search is
  36. pragma Preelaborate (Search);
  37.  
  38.    function Index
  39.      (Source   : in String;
  40.       Pattern  : in String;
  41.       Going    : in Direction := Forward;
  42.       Mapping  : in Maps.Character_Mapping := Maps.Identity)
  43.       return     Natural;
  44.  
  45.    function Index
  46.      (Source   : in String;
  47.       Pattern  : in String;
  48.       Going    : in Direction := Forward;
  49.       Mapping  : in Maps.Character_Mapping_Function)
  50.       return     Natural;
  51.  
  52.    function Index
  53.      (Source : in String;
  54.       Set    : in Maps.Character_Set;
  55.       Test   : in Membership := Inside;
  56.       Going  : in Direction  := Forward)
  57.       return   Natural;
  58.  
  59.    function Index_Non_Blank
  60.      (Source : in String;
  61.       Going  : in Direction := Forward)
  62.       return   Natural;
  63.  
  64.    function Count
  65.      (Source   : in String;
  66.       Pattern  : in String;
  67.       Mapping  : in Maps.Character_Mapping := Maps.Identity)
  68.       return     Natural;
  69.  
  70.    function Count
  71.      (Source   : in String;
  72.       Pattern  : in String;
  73.       Mapping  : in Maps.Character_Mapping_Function)
  74.       return     Natural;
  75.  
  76.    function Count
  77.      (Source   : in String;
  78.       Set      : in Maps.Character_Set)
  79.       return     Natural;
  80.  
  81.  
  82.    procedure Find_Token
  83.      (Source : in String;
  84.       Set    : in Maps.Character_Set;
  85.       Test   : in Membership;
  86.       First  : out Positive;
  87.       Last   : out Natural);
  88.  
  89. end Ada.Strings.Search;
  90.